package club.xyes.zkh.ecommerce.commons.entity;

import club.xyes.zkh.ecommerce.commons.context.ApplicationConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
 * Create by 郭文梁 2019/4/18 0018 14:14
 * ShopMembership
 * 商铺会员实体类
 *
 * @author 郭文梁
 * @data 2019/4/18 0018
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(name = "t_shop_membership")
public class ShopMembership extends BaseEntity {
    /**
     * 商铺ID
     */
    @Column(name = "shop_id", length = 10, nullable = false)
    private Integer shopId;
    /**
     * 商铺对象
     */
    private Shop shop;
    /**
     * 会员名称
     */
    @Column(name = "name", nullable = false)
    private String name;
    /**
     * 是否启用会员功能
     */
    @Column(name = "enabled", nullable = false)
    private Boolean enabled;
    /**
     * 过期时间
     */
    @Column(name = "expire_time", nullable = false)
    @JsonFormat(pattern = ApplicationConstants.DATE_TIME_FORMAT)
    private Date expireTime;
    /**
     * 描述信息
     */
    @Column(name = "description")
    private String description;
    /**
     * 图片
     */
    @Column(name = "image")
    private String image;
}
